"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ws_1 = require("ws");
var rxjs_1 = require("rxjs");
function createWebSocketServer(options) {
    var ws = new ws_1.default.Server(options, function () {
        console.log('web socket created!');
    });
    var connection = rxjs_1.fromEvent(ws, 'connection').pipe();
    var error = rxjs_1.fromEvent(ws, 'error').pipe();
    var headers = rxjs_1.fromEvent(ws, 'headers').pipe();
    var listening = rxjs_1.fromEvent(ws, 'listening').pipe();
    return rxjs_1.merge(connection, error, headers, listening);
}
exports.createWebSocketServer = createWebSocketServer;
